﻿

///////// <summary>
///////// 解析 var/const/let 内变量的定义。
///////// </summary>
///////// <param name="inFor">是否在 for 内。</param>
///////// <param name="declType">类型。</param>
///////// <returns>变量定义语句。</returns>
//////private VariableStatement ParseVariableStatement(bool disallowIn) {
//////    return null;
//////    //  VariableStatement : See 12.2
//////    //    var VariableDeclarationList ;
//////    //!     const VariableDeclarationList ;

//////    //TokenInfo tk = _lexer.Read();

//////    //Location current = tk.StartLocation;
//////    //NodeList<VariableDeclaration> vars = ParseVariableDeclarationList(disallowIn, tk.Type);

//////    //return new VariableStatement(vars, current, _lexer.Current.EndLocation);
//////}

///////// <summary>
///////// 解析变量定义列表。
///////// </summary>
///////// <param name="disallowIn">是否在 for 内。</param>
///////// <param name="declType">类型。</param>
///////// <returns>变量定义语句。</returns>
//////private List<VariableDeclaration> ParseVariableDeclarationList(bool disallowIn, TokenType declType) {
//////    return null;
//////    //  VariableStatement:
//////    //     var VariableDeclarationList;

//////    //  VariableDeclarationList :
//////    //    VariableDeclaration
//////    //    VariableDeclarationList , VariableDeclaration

//////    //  VariableDeclaration :
//////    //    Identifier Initialiseropt

//////    //  Initialiser :
//////    //    = AssignmentExpression

//////    //    NodeList<VariableDeclaration> vars = new NodeList<VariableDeclaration>();

//////    //redo:
//////    //    Identifier name;
//////    //    TokenInfo tk = _lexer.Read();

//////    //    switch (tk.Type) {

//////    //        case TokenType.Identifier:
//////    //            string s = _lexer.Current.Literal;
//////    //            DefineSymbol(declType, disallowIn, s);
//////    //            name = new Identifier(s, tk.StartLocation);
//////    //            break;

//////    //        default:
//////    //            name = null;
//////    //            Error(Messages.BadVar);
//////    //            break;

//////    //    }

//////    //    Expression init = null;
//////    //    if (MatchToken(TokenType.Assign)) {
//////    //        init = ParseAssignmentExpression(disallowIn);
//////    //    }

//////    //    if (name != null)
//////    //        vars.Add(new VariableDeclaration(name, init));

//////    //    if (MatchToken(TokenType.Comma))
//////    //        goto redo;

//////    //    return vars;
//////}

//////private ArgumentList ParseArguments() {

//////    //  Arguments : See 11.2
//////    //    ( )
//////    //    ( ArgumentList )

//////    ExpectToken(TokenType.LParam);

//////    bool matched = MatchToken(TokenType.RParam);

//////    ArgumentList arguments = null;
//////    if (!matched) {
//////        arguments = ParseArgumentList();

//////        ExpectToken(TokenType.RParam);
//////    }

//////    return arguments;
//////}

//////private ArgumentList ParseArgumentList() {

//////    //  ArgumentList : See 11.2
//////    //    AssignmentExpression
//////    //    ArgumentList , AssignmentExpression


//////    ArgumentList arguments = new ArgumentList();
//////    do {
//////        switch (_lexer.Peek().Type) {
//////            case TokenType.RParam:
//////                return arguments;

//////        }



//////       // arguments.Add(ParseAssignmentExpression(false));
//////    } while (MatchToken(TokenType.Comma));

//////    return arguments;

//////}

////// private Expression ParsePostfixExpression() {

//////     //  PostfixExpression : See 11.3
//////     //    LeftHandSideExpression
//////     //    LeftHandSideExpression [no LineTerminator here] ++
//////     //    LeftHandSideExpression [no LineTerminator here] --

//////     Expression ret = ParseLeftHandSideExpression();

//////     //if (!_lexer.HasLineTerminatorBeforeNext) {
//////     //    TokenType type = _lexer.Peek().Type;
//////     //    if (type == TokenType.Inc || type == TokenType.Dec) {
//////     //        _lexer.Read();
//////     //        return new PostfixExpression(ret, type, ret.StartLocation, _lexer.Current.EndLocation);
//////     //    }
//////     //}

//////     return ret;
////// }

////// private Expression ParseLeftHandSideExpression() {

//////     //  LeftHandSideExpression : See 11.3
//////     //    NewExpression
//////     //    CallExpression

//////     // NewExpression = new NewExpression | MemberExpression
//////     //               = new NewExpression | new MemberExpression Arguments | ..
//////     //               = new (NewExpression | MemberExpression Arguments) | ..

//////     return ParseMemberExpression(true);
////// }

////// private Expression ParseNewExpression(bool allowCallSyntax) {

//////     //  NewExpression : See 11.2
//////     //    MemberExpression
//////     //    new NewExpression

//////     Location current = _lexer.Read().StartLocation;

//////     Expression e = ParseMemberExpression(false);

//////     Expression ret = new NewExpression(e, _lexer.Peek().Type == TokenType.LParam ? ParseArguments() : null, current, _lexer.Current.EndLocation);

//////     return ret;
////// }

////// private Expression ParseMemberExpression(bool allowCallSyntax) {

//////     //  MemberExpression : See 11.2
//////     //    PrimaryExpression
//////     //    FunctionExpression
//////     //    MemberExpression [ Expression ]
//////     //    MemberExpression . Identifier
//////     //    MemberExpression -> Identifier
//////     //    new MemberExpression Arguments

//////     Expression e;

//////     switch (_lexer.Peek().Type) {
//////         case TokenType.New:
//////             e = ParseNewExpression(allowCallSyntax);
//////             break;

//////         //case TokenType.Function:
//////         //    e = ParseFunctionExpression(FunctionType.Expression);
//////         //    break;

//////         default:
//////             e = ParsePrimaryExpression();
//////             break;


//////     }


//////     return ParseCallExpression(allowCallSyntax, e);
////// }

////// private Expression ParseCallExpression(bool allowCallSyntax, Expression ret) {

//////     //  CallExpression : See 11.2
////// //    MemberExpression Arguments
////// //    CallExpression Arguments
////// //    CallExpression [ Expression ]
////// //    CallExpression . Identifier
////// //    CallExpression -> Identifier

//////redo:
//////     switch (_lexer.Peek().Type) {

//////         case TokenType.Period:
//////             _lexer.Read();

//////             ExpectToken(TokenType.Identifier);

//////             ret = new PropertyCallExpression(ret, _lexer.Current.Literal, _lexer.Current.EndLocation);
//////             goto redo;

//////         case TokenType.LBrack:
//////         //_lexer.Read();
//////         //Expression p = ParseExpression(false);
//////         //ExpectToken(TokenType.RBrack, Messages.ExpectedArrayIndex);
//////         //ret = new IndexCallExpression(ret, p, _lexer.Current.EndLocation);
//////         //goto redo;

//////         case TokenType.LParam:
//////             if (!allowCallSyntax) {
//////                 return ret;
//////             }
//////             _lexer.Read();
//////             ArgumentList args = ParseArgumentList();
//////             ExpectToken(TokenType.RParam);
//////             ret = new FunctionCallExpression(ret, args, _lexer.Current.EndLocation);
//////             goto redo;

//////         default:
//////             return ret;
//////     }
////// }
////// void aaaa() {
//////     Console.Write("_________________");
////// }
////// private Expression ParsePrimaryExpression() {

//////     //  PrimaryExpression :
//////     //    this
//////     //    base
//////     //    Identifier
//////     //    Literal
//////     //    ListLiteral
//////     //    DictionaryLiteral
//////     //    ( Expression )
//////     //    FunctionExpression

//////     //  Literal :
//////     //    NullLiteral
//////     //    BooleanLiteral
//////     //    NumericLiteral
//////     //    StringLiteral
//////     //    CharacterLiteral
//////     //    TemplateStringLiteral
//////     //    RegExpLiteral
//////     //    WideCharLiteral
//////     //    XmlLiteral
//////     //    DataLiteral

//////     //  NumericLiteral :
//////     //    IntegerLiteral
//////     //    RealLiteral

//////     //  IntegerLiteral :
//////     //    IntLiteral
//////     //    UIntLiteral
//////     //    LongLiteral
//////     //    ULongLiteral
//////     //    DecimalLiteral
//////     //    HexLiteral

//////     //  RealLiteral :
//////     //    DoubleLiteral
//////     //    FloatLiteral

//////     Expression ret;

//////     switch (_lexer.Read().Type) {

//////         case TokenType.LParam:
//////         //if (DoParseParamExpression) {
//////         //    Location current = _lexer.Current.StartLocation;
//////         //    ret = ParseExpression(false);
//////         //    ExpectToken(TokenType.RParam);

//////         //    ret = new ParamedExpression(ret, current, _lexer.Current.EndLocation);
//////         //} else {
//////         //    ret = ParseExpression(false);
//////         //    //   ret.putProp(Node.PARENTHESIZED_PROP, bool.TRUE);
//////         //    //  ret.ParamNum++;
//////         //    ExpectToken(TokenType.RParam);
//////         //}
//////         //return ret;

//////         case TokenType.LBrack:
//////         // return ParseArrayLiteral();

//////         case TokenType.LBrace:
//////         // return ParseObjectLiteral();

//////         case TokenType.Identifier: {

//////                 //switch (_lexer.Peek().Type) {

//////                 //    // 标识符后尾跟标识符，则前面的标志符表示类型。
//////                 //    case TokenType.Identifier:
//////                 //        break;

//////                 //    // 标识符后是<， 则此标志符作为类型处理。
//////                 //    case TokenType.Lt:

//////                 //        break;

//////                 //    default:

//////                 //        break;
//////                 //}

//////                 string name = _lexer.Current.Literal;
//////                 //  if (_checkTokenLabel && scanner.Peek().Type == TokenType.Colon) {
//////                 // Do not consume colon, it is used as unwind indicator
//////                 // to return to ParseStatement()Helper.
//////                 // XXX BetokenTypeer way?
//////                 // return new LabelClause(name, scanner.CurrentToken.StartLocation);
//////                 //  }

//////                 //  if (compilerEnv.isXmlAvailable()) {
//////                 //      ret = ParsePropertyName(null, name, 0);
//////                 //  } else {
//////                 return new Identifier(name, _lexer.Current.StartLocation);
//////                 //   }
//////             }

//////         case TokenType.Class:
//////         case TokenType.Struct:
//////         case TokenType.Enum:
//////         case TokenType.Interface:
//////             break;

//////         case TokenType.Public:
//////         case TokenType.Protected:
//////         case TokenType.Static:
//////         case TokenType.Event:
//////         case TokenType.Abstract:
//////         case TokenType.Volatile:


//////             break;

//////         case TokenType.Lt:
//////             break;

//////         case TokenType.IntLiteral:
//////         case TokenType.UIntLiteral:
//////         case TokenType.LongLiteral:
//////         case TokenType.ULongLiteral:
//////         case TokenType.DecimalLiteral:
//////         case TokenType.DoubleLiteral:
//////         case TokenType.FloatLiteral:
//////         // return new NumberLiteral(_lexer.Current.Literal, _lexer.Current.StartLocation);

//////         case TokenType.DataLiteral:

//////         case TokenType.TemplateStringLiteral:
//////             return new StringLiteral(_lexer.Current.Literal, '\'', _lexer.Current.StartLocation, _lexer.Current.EndLocation);

//////         case TokenType.StringLiteral:
//////             return new StringLiteral(_lexer.Current.Literal, '\"', _lexer.Current.StartLocation, _lexer.Current.EndLocation);

//////         case TokenType.NullLiteral:
//////             return new NullLiteral(_lexer.Current.StartLocation);
//////         case TokenType.This:
//////             return new ThisLiteral(_lexer.Current.StartLocation);
//////         case TokenType.FalseLiteral:
//////             return new FalseLiteral(_lexer.Current.StartLocation);
//////         case TokenType.TrueLiteral:
//////             return new TrueLiteral(_lexer.Current.StartLocation);


//////         case TokenType.Div:
//////         //case TokenType.AssignDiv: {

//////         //        // 得到 / 和 /=  后， 解析正则。
//////         //        //Location current = _lexer.PeekToken.StartLocation;
//////         //        //string s = _lexer.ScanRegularExpressionBody();
//////         //        //if (s != null) {
//////         //        //    string s2 = js.ScanRegularExpressionFlags();
//////         //        //    return new RegExpLiteral(s, s2, current, _lexer.Current.EndLocation);
//////         //        //}
//////         //        //Error(Messages.BadRegExp);

//////         //        //break;

//////         //    }

//////         case TokenType.Mod:
//////         //case TokenType.AssignMod: {

//////         //        // 得到 / 和 /=  后， 解析正则。
//////         //        //Location current = _lexer.PeekToken.StartLocation;
//////         //        //string s = _lexer.ScanRegularExpressionBody();
//////         //        //if (s != null) {
//////         //        //    string s2 = js.ScanRegularExpressionFlags();
//////         //        //    return new RegExpLiteral(s, s2, current, _lexer.Current.EndLocation);
//////         //        //}
//////         //        //Error(Messages.BadRegExp);

//////         //        //break;

//////         //    }

//////         case TokenType.EOF:
//////             Error("UnexpectedEOF");
//////             break;

//////         default:
//////             Error("Syntax");
//////             break;
//////     }
//////     return new NullLiteral(_lexer.Current.StartLocation);
////// }

////// private ArrayLiteral ParseArrayLiteral() {
//////     return null;
//////     //  ArrayLiteral :
//////     //    [ Elision? ]
//////     //    [ ElementList ]
//////     //    [ ElementList , Elision? ]

//////     //  ElementList :
//////     //    Elision? AssignmentExpression
//////     //    ElementList , Elision? AssignmentExpression

//////     //  Elision :
//////     //    ,
//////     //    Elision ,

//////     // 已经 处理 [ 

//////     //    Location current = _lexer.Current.StartLocation;

//////     //    NodeList<Expression> values = new NodeList<Expression>();
//////     //    bool after = true;
//////     //redo:
//////     //    switch (_lexer.Peek().Type) {

//////     //        case TokenType.Comma:
//////     //            _lexer.Read();
//////     //            if (!after) {
//////     //                after = true;
//////     //            } else {
//////     //                values.Add(new UndefinedExpression(_lexer.Current.StartLocation));
//////     //            }

//////     //            goto redo;
//////     //        case TokenType.RBrack:
//////     //            _lexer.Read();
//////     //            break;

//////     //        default:
//////     //            //    if (skipCount == 0 && elems.size() == 1 &&
//////     //            //           tokenType == TokenType.FOr) {
//////     //            //    Node scopeNode = nf.createScopeNode(Token.ARRAYCOMP,
//////     //            //                                        ts.getLineno());
//////     //            //    String tempName = currentScriptOrFn.getNextTempName();
//////     //            //    pushScope(scopeNode);
//////     //            //    try {
//////     //            //        DefineSymbol(Token.LET, false, tempName);
//////     //            //        Node expr = (Node)elems.get(0);
//////     //            //        Node block = nf.createBlock(ts.getLineno());
//////     //            //        Node init = new Node(Token.EXPR_VOID,
//////     //            //            nf.createAssignment(Token.ASSIGN,
//////     //            //                nf.createName(tempName),
//////     //            //                nf.createCallOrNew(Token.NEW,
//////     //            //                    nf.createName("Array"))), ts.getLineno());
//////     //            //        block.addChildToBack(init);
//////     //            //        block.addChildToBack(ParseArrayComprehension(tempName,
//////     //            //            expr));
//////     //            //        scopeNode.addChildToBack(block);
//////     //            //        scopeNode.addChildToBack(nf.createName(tempName));
//////     //            //        return scopeNode;
//////     //            //    } finally {
//////     //            //        popScope();
//////     //            //    }
//////     //            //} else {

//////     //            if (!after) {
//////     //                Error(Messages.NoBracketArgs);
//////     //            }
//////     //            values.Add(ParseAssignmentExpression(false));
//////     //            after = false;


//////     //            goto redo;
//////     //        // }
//////     //    }


//////     //    return new ArrayLiteral(values, current, _lexer.Current.EndLocation);
////// }



////        private Expression ParseConditionalExpression() {

////            //  ConditionalExpression :
////            //    LogicalOrExpression
////            //    LogicalOrExpression ? AssignmentExpression : AssignmentExpression

////            Expression ret = ParseLogicalOrExpression();

////            if (MatchToken(TokenType.Conditional)) {
////                //Expression trueExpression = ParseAssignmentExpression(false);
////                //ExpectToken(TokenType.Colon);
////                //Expression falseExpression = ParseAssignmentExpression(disallowIn);
////                //return new ConditionalExpression(condition, trueExpression, falseExpression);
////            }

////            return ret;


////        }

////        private Expression ParseLogicalOrExpression() {
////            return null;
////            //  LogicalOrExpression :
////            //    LogicalAndExpression
////            //    LogicalOrExpression || LogicalAndExpression

////            //Expression ret = ParseLogicalAndExpression();
////            //if (MatchToken(TokenType.Or)) {
////            //    //ret = new LogicalExpression(ret, TokenType.Or, ParseLogicalOrExpression(disallowIn));
////            //}

////            //return ret;
////        }

////        private Expression ParseLogicalAndExpression(bool disallowIn) {

////            //  LogicalAndExpression :
////            //    BitwiseOrExpression
////            //    LogicalAndExpression && BitwiseOrExpression

////            Expression ret = ParseBitwiseOrExpression(disallowIn);
////            if (MatchToken(TokenType.And)) {
////                //  ret = new LogicalExpression(ret, TokenType.And, ParseLogicalAndExpression(disallowIn));
////            }

////            return ret;
////        }

////        private Expression ParseBitwiseOrExpression(bool disallowIn) {

////            //  BitwiseOrExpression : See 11.10
////            //    BitwiseXOrExpression
////            //    BitwiseOrExpression | BitwiseXOrExpression

////            Expression ret = ParseBitwiseXOrExpression(disallowIn);
////            while (MatchToken(TokenType.BitOr)) {
////                //   ret = new BitwiseExpression(ret, TokenType.BitOr, ParseBitwiseXOrExpression(disallowIn));
////            }
////            return ret;
////        }

////        private Expression ParseBitwiseXOrExpression(bool disallowIn) {
////            return null;
////            //  BitwiseXOrExpression : See 11.10
////            //    BitwiseAndExpression
////            //    BitwiseOrExpression ^ BitwiseAndExpression

////            //Expression ret = ParseBitwiseAndExpression(disallowIn);
////            //while (MatchToken(TokenType.BitXor)) {
////            //    ret = new BitwiseExpression(ret, TokenType.BitXor, ParseBitwiseAndExpression(disallowIn));
////            //}
////            //return ret;
////        }

////        private Expression ParseBitwiseAndExpression(bool disallowIn) {
////            return null;
////            //  BitwiseAndExpression : See 11.10
////            //    EqualityExpression
////            //    BitwiseAndExpression & EqualityExpression

////            //Expression ret = ParseEqualityExpression(disallowIn);
////            //while (MatchToken(TokenType.BitAnd)) {
////            //    ret = new BitwiseExpression(ret, TokenType.BitAnd, ParseEqualityExpression(disallowIn));
////            //}
////            //return ret;
////        }

////        private Expression ParseEqualityExpression() {
////            return null;
////            //    //  EqualityExpression : See 11.9
////            //    //    RelationalExpression
////            //    //    EqualityExpression == RelationalExpression
////            //    //    EqualityExpression != RelationalExpression
////            //    //    EqualityExpression === RelationalExpression
////            //    //    EqualityExpression !== RelationalExpression

////            //    Expression ret = ParseRelationalExpression(disallowIn);
////            //redo:
////            //    switch (_lexer.Peek().Type) {
////            //        case TokenType.Eq:
////            //        case TokenType.Ne:
////            //        case TokenType.EqStrict:
////            //        case TokenType.NeStrict:
////            //            ret = new EqualityExpression(ret, _lexer.Read().Type, ParseRelationalExpression(disallowIn));
////            //            goto redo;
////            //    }
////            //    return ret;
////        }

////        private Expression ParseRelationalExpression(bool disallowIn) {

////            //  RelationalExpression : See 11.8
////            //    ShiftExpression
////            //    RelationalExpression < ShiftExpression
////            //    RelationalExpression > ShiftExpression
////            //    RelationalExpression <= ShiftExpression
////            //    RelationalExpression >= ShiftExpression
////            //    RelationalExpression instanceof ShiftExpression
////            //    RelationalExpression in ShiftExpression

////            Expression ret = ParseShiftExpression();
////        redo:
////            TokenType tokenType = _lexer.Peek().Type;
////            switch (tokenType) {
////                case TokenType.In:
////                    if (disallowIn)
////                        break;

////                    goto case TokenType.Gt;
////                //  case TokenType.Instanceof:
////                case TokenType.Lte:
////                case TokenType.Lt:
////                case TokenType.Gte:
////                case TokenType.Gt:
////                    _lexer.Read();
////                    //     ret = new RelationalExpression(ret, tokenType, ParseShiftExpression());
////                    goto redo;
////            }
////            return ret;
////        }

////        private Expression ParseShiftExpression() {

////            //  ShiftExpression :
////            //    AdditiveExpression
////            //    ShiftExpression << AdditiveExpression
////            //    ShiftExpression >> AdditiveExpression

////            Expression ret = ParseAdditiveExpression();
////        redo:
////            TokenType tokenType = _lexer.Peek().Type;
////            switch (tokenType) {
////                case TokenType.Shl:
////                case TokenType.Shr:
////                    _lexer.Read();
////                    //  ret = new ShiftExpression(ret, tokenType, ParseAdditiveExpression());
////                    goto redo;
////            }
////            return ret;
////        }

////        private Expression ParseAdditiveExpression() {

////            //  AdditiveExpression :
////            //    MultiplicativeExpression
////            //    AdditiveExpression + MultiplicativeExpression
////            //    AdditiveExpression - MultiplicativeExpression

////            Expression ret = ParseMultiplicativeExpression();
////        redo:
////            TokenType tokenType = _lexer.Peek().Type;
////            if (tokenType == TokenType.Add || tokenType == TokenType.Sub) {
////                _lexer.Read();
////                // flushNewLines
////                //   ret = new AdditiveExpression(ret, tokenType, ParseMultiplicativeExpression());
////                goto redo;
////            }

////            return ret;
////        }

////        private Expression ParseMultiplicativeExpression() {

////            //  MultiplicativeExpression : See 11.5
////            //    UnaryExpression
////            //    MultiplicativeExpression * UnaryExpression
////            //    MultiplicativeExpression / UnaryExpression
////            //    MultiplicativeExpression % UnaryExpression

////            Expression ret = ParseUnaryExpression();
////        redo:
////            TokenType tokenType = _lexer.Peek().Type;
////            switch (tokenType) {
////                case TokenType.Mul:
////                case TokenType.Div:
////                case TokenType.Mod:
////                    _lexer.Read();
////                    //   ret = new MultiplicativeExpression(ret, tokenType, ParseUnaryExpression());
////                    goto redo;
////            }

////            return ret;
////        }

////        private Expression ParseUnaryExpression() {
////            throw new NotImplementedException();

////            TokenType tokenType = _lexer.Peek().Type;

////            switch (tokenType) {
////                //    case TokenType.Void:
////                //    case TokenType.Not:
////                //    case TokenType.BitNot:
////                //    case TokenType.Typeof:
////                case TokenType.Add:
////                //return new AddUnaryExpression(_lexer.Read().StartLocation, ParseUnaryExpression());

////                //    case TokenType.Sub:
////                //    case TokenType.Delete:
////                //    case TokenType.Inc:
////                //    case TokenType.Dec:
////                //        _lexer.Read();
////                //        Location current2 = _lexer.Current.StartLocation;
////                //        return new IncrementOperation(ParseMemberExpression(true), tokenType, current2);

////                //    //case TokenType.Lt:
////                //    //   return ParseXmlInitializer();

////                //    default:
////                //        return ParsePostfixExpression();
////            }

////        }

////        private Expression ParseXmlInitializer() {
////            throw new NotSupportedException();
////        }



//        //private Expression ParseExpression() {
//        //    return ParseExpression(0);




//        //    //return ret;


//        //    // Expression :
//        //    //   AssignmentExpression
//        //    //   Expression , AssignmentExpression

//        //    //Expression ret = ParseAssignmentExpression();
//        //    //while (MatchToken(TokenType.Comma)) {
//        //    //    //if (IsStrictMode && !ret.HasSideEffects)
//        //    //    //    WarningStrict(Messages.HasSideEffects);
//        //    //    //ret = new CommaExpression(ret, ParseAssignmentExpression(disallowIn));
//        //    //}
//        //    //return ret;
//        //}

//        private Expression ParseAssignmentExpression() {

//            // AssignmentExpression :
//            //   ConditionalExpression
//            //   LeftHandSideExpression AssignmentOperator AssignmentExpression

//            // AssignmentOperator : one of
//            //   =   :=   :=:  +=   -=   *=   /=   %=   &=   |=   ^=   <<=   >>=  &&=   ||=

//            Expression ret = ParseConditionalExpression();

//            TokenType tokenType = _lexer.Peek().Type;
//            if (TokenType.Assign <= tokenType && tokenType <= TokenType.AssignMod) {
//                _lexer.Read();
//                //ret = new AssignmentExpression(tokenType, ret, ParseAssignmentExpression(disallowIn));
//            }

//            return ret;
//        }

//        private static bool IsGetterOrSetter(StringBuilder sb) {
//            return sb.Length == 3 && sb[1] == 'e' && sb[2] == 't' && (sb[0] == 'g' || sb[0] == 's');
//        }

        //private List<Identifier> ParseFormalParameterList() {
        //    return null;
        //    //  FormalParameterList : See clause 13
        //    //    Identifier
        //    //    FormalParameterList , Identifier


        //    //    ExpectToken(TokenType.LParam);
        //    //    List<Identifier> args = new List<Identifier>();
        //    //redo:
        //    //    switch (_lexer.Read().Type) {
        //    //        case TokenType.Identifier:
        //    //            TokenInfo tk = _lexer.Current;
        //    //            string s = tk.Literal;
        //    //            DefineSymbol(TokenType.Function, true, s);

        //    //            if (IsStrictMode && args.Find(i => i.Name == s) != null) {
        //    //                WarningStrict(Messages.DumpParam, s);
        //    //            }
        //    //            args.Add(new Identifier(s, tk.StartLocation));
        //    //            break;

        //    //        case TokenType.RParam:
        //    //            return args;

        //    //        default:
        //    //            Error(Messages.NoParam);
        //    //            break;


        //    //    }

        //    //    if (MatchToken(TokenType.Comma))
        //    //        goto redo;

        //    //    ExpectToken(TokenType.RParam);
        //    //    return args;


        //}

        //private FunctionExpression ParseFunctionExpression() {
        //    return null;
        //    //  FunctionExpression :   See clause 13
        //    //    function Identifieropt ( FormalParameterListopt ) { FunctionBody }

        //    //_checkStrictMode = true;

        //    //Location current = _lexer.Read().StartLocation;
        //    //string name;

        //    ////  function f()
        //    //if (MatchToken(TokenType.Identifier)) {
        //    //    name = _lexer.Current.Literal;

        //    //} else {
        //    //    name = null;
        //    //}

        //    //// 函数的定义，作为变量定义。
        //    //if (functionType == FunctionType.Statement) {
        //    //    if (name == null) {
        //    //        if (MatchToken(TokenType.Illegal) || MatchToken(TokenType.NumberLiteral)) {
        //    //            MatchToken(TokenType.Identifier);
        //    //            Error(Messages.InvalidName);
        //    //        } else {
        //    //            Error(Messages.NoFuncName);
        //    //        }
        //    //        name = String.Empty;
        //    //    }
        //    //    DefineSymbol(TokenType.Function, false, name);
        //    //}

        //    //List<Identifier> args = ParseFormalParameterList();

        //    //FunctionExpression fn = new FunctionExpression(name, args, current);

        //    //// 重新赋予 break 语句。
        //    //BreakableStatement savedBreakableBlock = _breakableBlock;
        //    //_breakableBlock = null;

        //    //// 重新绑定 currentScope 。
        //    //IScopeNode savedScript = _currentScope;
        //    //_currentScope = fn;

        //    ////Node destructuring = null;
        //    ////Node body;
        //    //try {
        //    //    ParseFunctionBody();


        //    //    fn.endLocation = _lexer.Current.EndLocation;





        //    //} finally {
        //    //    _breakableBlock = savedBreakableBlock;
        //    //    _currentScope = savedScript;

        //    //}

        //    //return fn;
//}

//private FunctionDeclaration ParseFunctionDeclaration() {

//    //  FunctionDeclaration : See clause 13
//    //    function Identifier ( FormalParameterListopt ) { FunctionBody }

//    FunctionDeclaration fn = new FunctionDeclaration(ParseFunctionExpression(FunctionType.Statement));

//    _currentScope.AddFunction(fn);

//    return fn;
//}